<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0'>
	<title>arduino@home</title>


	<style type="text/css">
		body {font-family:'微軟正黑體','黑體-繁',sans-serif;background-color:#CC0;}/*设置body的颜色*/
		.sw {margin:0 0.5em;font-weight:bolder;}
		.on {color:#F00;}/*span内的颜色*/
		.off {color:#090;}
		#lights {border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;background-color:#129900;padding:1px;}
		#lights ul  {list-style-type:none;padding-left:0px;font-size:24pt;}
		#lights ul  li {margin:10px 0;border-bottom:1px dotted #CCCCCC;padding-bottom:5px;}
		/*分割线，颜色设置为#CCCCCC*/
		#lights ul  li a {display:block;text-decoration:none;color:#000;}
	</style>
</head>
<body>
	<h1>灯光控制</h1>
	<div id="lights">
	<ul>
		<script type="text/javascript">//使用js进行for循环，批量设置
			var cars=["柜灯", "壁灯", "吊灯", "落地灯", "熔岩灯", "藤球灯"];
			for (var i=0;i<6;i++){
				document.write("<li><a href=\"sw?id="+i+"\"><span class=\"sw on\">ON</span>"+cars[i]+"</a></li>");

			}
		</script>
	</ul>
	</div>

</body>
</html>